/**
 * @Author: Liu.ZH
 * @Date: 2020-03-15
 * @Description:
 */

!(function () {
    var zkTheme = localStorage.getItem('zkTheme') || 'technology';
    var html = document.querySelectorAll('html');
    
    // var html = document.querySelectorAll('html')
    // html[0].setAttribute('data-theme', zkTheme);
    // var env = import.meta.env;

    var htmlTpl = html[0].getAttribute('data-theme');
    // var crjs = document.createElement('script');
    // crjs.src = '/vite/dev_header.js';
    // crjs.type="module"
    // document.head.appendChild(crjs);
// tailwindcss样式标签插入
	var twCsslink =document.createElement('link');
	twCsslink.media="all";
	twCsslink.rel="stylesheet";
	twCsslink.href= "/vite/css/tailwindcss-vite.css";
	document.head.appendChild(twCsslink);
// 项目样式标签插入
	var projCssLink =document.createElement('link');
	projCssLink.media="all";
	projCssLink.rel="stylesheet";
	projCssLink.href= "/vite/less/theme/all/index-vite.less";
	document.head.appendChild(projCssLink);
    // 强制主题名称
    if (htmlTpl) {
        return;
    } else {
        // if(zkTheme=='classic' || zkTheme=='technology'){
        // 	html[0].setAttribute('data-theme', zkTheme+'1');
        // }else{
        // 	html[0].setAttribute('data-theme', zkTheme);
        // }
        html[0].setAttribute('data-theme', zkTheme);
    }
})();
